Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for checking out a stacked PR set from GitHub when gh stack checkout is given a PR number, importing branches and creating local stack tracking; branch-name checkout remains local-only.
Changes:
- Extend
gh stack checkoutto resolve numeric targets via GitHub stack APIs (list stacks, fetch PR details, import branches, reconcile with local stacks). - Add GitHub client interface support for listing stacks and fetching PRs by number (plus mock support) and update user-facing docs accordingly.
- Improve Ctrl+C prompt cleanup for Select prompts and adjust messaging for “stacked PRs not enabled”.
Show a summary per file
| File | Description |
|---|---|
| skills/gh-stack/SKILL.md | Updates skill docs to describe PR-number remote checkout and clarify branch-name is local-only. |
| README.md | Updates command reference docs to describe remote checkout behavior and CLI syntax. |
| internal/github/mock_client.go | Adds mock hooks for FindPRByNumber and ListStacks. |
| internal/github/github.go | Adds FindPRByNumber, ListStacks, and refactors repositoryID placement. |
| internal/github/client_interface.go | Extends ClientOps with FindPRByNumber and ListStacks. |
| docs/src/content/docs/reference/cli.md | Updates published CLI docs to match new checkout behavior. |
| cmd/utils.go | Adds clearSelectPrompt for cleaning up interrupted Select prompts. |
| cmd/submit.go | Updates warning text for 404 “stacked PRs not enabled”. |
| cmd/submit_test.go | Updates assertion to match new warning text. |
| cmd/rebase.go | Removes Cobra Example text. |
| cmd/push.go | Clears Select prompt on interrupt when choosing a remote. |
| cmd/init.go | Removes Cobra Example text. |
| cmd/checkout.go | Implements remote stack checkout by PR number, stack import, and conflict resolution flow. |
| cmd/checkout_test.go | Adds extensive tests covering numeric target behavior and remote import flows. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
cmd/checkout.go:490
- importRemoteStack ignores the error from git.RevParse(trunk) when computing trunkSHA. If RevParse fails, the stack is saved with an empty/incorrect trunk head, which can mislead later logic relying on trunk metadata. Handle the error and abort (or at least surface a clear error) rather than silently discarding it.
trunkSHA, _ := git.RevParse(trunk)
newStack := stack.Stack{
ID: remoteStackID,
Trunk: stack.BranchRef{
Branch: trunk,
- Files reviewed: 14/14 changed files
- Comments generated: 4
|
Warning This is an internal experiment to assess Copilot's ability to auto-approve PRs. Please 👍 this comment if the assessment below is correct and 👎 if not. Feedback in #f-ccr-auto-approve is appreciated! Copilot thinks this PR is not ready to approve — see review comments for details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
gh stack checkoutcommand now supports checking out stacks from GitHub using a PR number, pulling branches and setting up the stack locally. When a branch name is provided, the command only resolves locally tracked stacks.